package bank.model.vo;

public class Account {

	public int money;	
	private int id;
	private static int nextId=1;
	
	Account sourceAccount, recieverAccount;


	public Account(Client client) {
		//super(client);		
		money=client.getBudget();
		this.setMoney(money);
		this.setId(getNextId());
		client.accounts.add(this);		
	}	

	private void setId(int id) {
		this.id=id;
		if (id>=nextId){
			id++;
			nextId=id;
		}
	}
	public int getId(){
		return id;
	}
	
	public static void setNextId(int id){
		if (id >= nextId)
		nextId = id;		
	}

	private int getNextId() {		
		return nextId;
	}

	public void setMoney(int money) {
		this.money=money;		
	}
	
	public int getMoney(){
		return money;
	}
	
	public void setSourceAccount(Account account){
		sourceAccount=account;		
	}
	
	public void setRecieverAccount(Account account){
		recieverAccount=account;
	}
	public Client getClient(Client client){
		return client;
	}
	
	
    
	protected void generateLines() {
		/*
		addLine(String.format("=============== Account %d ===============\n",getId()));
    	addLine(String.format("Client: %d\n", this.toString()));    	
    	addLine(String.format("Bank employee: %s\n", getEmployee().toString()));
    	addLine(String.format("Date: %s\n", getCreationDate().toString()));
		
		*/
	}
	

}
